package org.six11.olive.collabclient;

import java.awt.event.MouseEvent;

//import org.six11.olive3.net.MessageNames;
//import org.six11.olive3.net.OliveNetworkTransmitter;
//import org.six11.olive3.net.Message.Statement;
import org.six11.util.Debug;
import org.six11.util.pen.MouseThing;
import org.six11.util.pen.Pt;

/**
 * 
 * 
 * @author Gabe Johnson <johnsogg@cmu.edu>
 * 
 */
public class OliveMouseThing extends MouseThing {

  private OliveState state;

  OliveMouseThing(OliveState state) {
    this.state = state;
  }

  public void mousePressed(MouseEvent ev) {
    state.addLocalSequenceBegin(new Pt(ev));
  }

  public void mouseDragged(MouseEvent ev) {
    state.addLocalSequenceProgress(new Pt(ev));
  }

  public void mouseReleased(MouseEvent ev) {
    state.addLocalSequenceEnd(new Pt(ev));
  }

  @SuppressWarnings("unused")
  private void bug(final String what) {
    Debug.out("OliveMouseThing", what);
  }

  public static String getPtString(MouseEvent ev) {
    return "pt " + ev.getX() + " " + ev.getY() + " t=" + ev.getWhen();
  }
}
